#{extends 'CRUD/layout.html' /}

<div id="crudShow" class="${type.name}">
	
	<h2 id="crudShowTitle">&{'crud.show.title', type.modelName}</h2>
	
	<div class="objectForm">
	#{form action:@save(object._key()), enctype:'multipart/form-data'}
		#{crud.form fields:['date', 'city', 'description', 'temperature', 'safeToFly', 'note', 'affectedFlights']}
      #{crud.custom 'note'}
        #{field 'object.note.text'}
          <label for="note">&{'note'}</label>
          <textarea id="note" rows="5" cols="50" name="${field.name}">${object.note?.text}</textarea>
        #{/field}
      #{/crud.custom}
		#{/crud.form}
		<p class="crudButtons">
			<input type="submit" name="_save" value="&{'crud.save', type.modelName}" />
			<input type="submit" name="_saveAndContinue" value="&{'crud.saveAndContinue', type.modelName}" />
		</p>
	#{/form}
	</div>
	
	#{form @delete(object._key())}
		<p class="crudDelete">
			<input type="submit" value="&{'crud.delete', type.modelName}" />
		</p>
	#{/form}

</div>